#ifndef CUSTOMBOX_H
#define CUSTOMBOX_H

#include <QWidget>
#include "ui_custombox.h"
#include "titlebar.h"

enum ChosseResult
{
    ID_OK = 0,                      //确定
    ID_CANCEL                     //取消
};

enum BType
{
    BUTTON_OK = 0,                             //只有确定按钮
    BUTTON_OK_AND_CANCEL,            //确定/取消按钮
};

class CustomBox : public QWidget
{
    Q_OBJECT

public:
    CustomBox(QWidget *parent = Q_NULLPTR);
    ~CustomBox();

    void SetContentText(QString ContentText);
    void SetButtonType(BType ButtonType);

public:
    ChosseResult BoxShow();

private:
    private slots:
    void OnOkClicked();
    void OnCancelClicked();
    void OnBoxCloseClicked();

private:
    Ui_MyMessageBox ui;

    void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE;
    void closeEvent(QCloseEvent *event) Q_DECL_OVERRIDE;

    TitleBar* AtTitleBar;
    QEventLoop* EventLoop;
    ChosseResult Result;
};
#endif

